<template>
	<view class="me-cell">
		
		<view>
			<s-pull-scroll ref="pullScroll" :pullDown="pullDown" :enablePullDown="false" :pullUp="loadData" :back-top="true">
				<u-cell-group :border="false">
					<u-cell-item :border-bottom="false" :title="item.title" @click="navTo(`/pages/public/helpdetails?id=${item.id}&title=${item.title}`)" v-for="(item,index) in dataList" :key="index"></u-cell-item>
				</u-cell-group>
			</s-pull-scroll>
		</view>
		<mix-loading v-if="isLoading"></mix-loading>
		
	</view>
</template>
<script>
export default {
	data() {
		return {
			dataList: []
		};
	},
	onLoad() {
		this.refresh();
	},
	methods: {
		pullDown(pullScroll) {
			setTimeout(() => {
				this.loadData(pullScroll);
			}, 200);
		},
		async loadData(pullScroll) {
			const data = {
				uid: uni.getStorageSync('uid'),
				pageNo: pullScroll.page,
				pageSize: '20'
			};
			const res = await this.$request('content/question-list', data, { showLoading: true });
			if (pullScroll.page == 1) this.dataList = [];
			if (res.result == 0) {
				this.dataList = this.dataList.concat(res.data.list);
				pullScroll.endByPage(Math.ceil(res.data.count / 20), res.data.list);
			} else {
				this.$util.msg(res.resultNote);
			}
		}
	}
};
</script>

<style></style>
